<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>

<div class="t_bar">项目简要信息</div>

<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="tblMileStonesx">
	<col style="width:15%"/>
	<col style="width:35%"/>
	<col style="width:15%"/>
	<col style="width:35%"/>

	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>项目名称：</td>
		<td>
			<input type="text" id="zh_title" name="proposal/zh_title" maxlength="200" class="required" label="项目名称" value="<x:out select="$xmlData/data/proposal/zh_title"/>" />
		</td>
		<td align="right">项目承担单位：</td>
		<td>
			<span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>
		</td>
	</tr>

	<tr class="li_2">
		<td align="right">项目类别：</td>
		<td colspan="3">
			<span name="proposal/sub_grant_name"><x:out select="$xmlData/data/proposal/sub_grant_name"/></span>
		</td>
		<%--<td align="right"><span class="color_red">*</span>批准金额（万元）：</td>
		<td>
			<input type="text" id="atm" name="proposal/atm" class="required" label="批准金额" style="text-align: right;" onfocus="InitInput.setNumber(this,9,2,2)" value="<x:out select="$xmlData/data/proposal/atm"/>" />
		</td>--%>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>项目主管部门：</td>
		<td >
			<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value"/>', 'name':'<x:out select="$xmlData/data/proposal/recomend_org_name"/>' }</c:set>
			<cpt:tree id="recomend_org" key="recommended_org" cacheable="false" className="hn_iuput_kuang required selectWidth3" readonly="true" value="${recomend_org}" label="项目主管部门" showPattern="all" shieldPattern="0" onClick="initTreeValue2"></cpt:tree>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" value="<x:out select="$xmlData/data/proposal/recomend_org_value" />"/>
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />"/>
		</td>
		<td align="right">承担单位地址：</td>
		<td >
			<span name="organizations/organization/address"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" /></span>
		</td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>项目开始时间：</td>
		<td>
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className=" required date dateCompare:end_date " label="项目开始时间"></cpt:date>
		</td>
		<td align="right"><span class="color_red">*</span>项目结束时间：</td>
		<td>
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" value="${end_date}" className=" required date" label="项目结束时间"></cpt:date>
		</td>
	</tr>
	<tr>
		<td align="right">项目负责人：</td>
		<td>
			<span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td align="right">联系电话：</td>
		<td>
			<span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>项目联系人：</td>
		<td>
			<input type="text" id="psncname" name="proposal/contact_psn_cname" maxlength="30"  class="required" label="项目联系人" value="<x:out select="$xmlData/data/proposal/contact_psn_cname"/>" />
		</td>
		<td align="right"><span class="color_red">*</span>联系电话：</td>
		<td>
			<input type="text" id="psnmobile" name="proposal/contact_psn_mobile" class="required" label="联系电话" maxlength="30"  value="<x:out select="$xmlData/data/proposal/contact_psn_mobile"/>" />
		</td>
	</tr>

	<tr>
		<td align="right"><span class="color_red">*</span>项目负责人所属内设机构或学院（没有可填无）：</td>
		<td>
			<input type="text"  name="proposal/built_institute" class="required" onchange="synchronizationAmount1()"  id="built_institute" maxlength="30" value="<x:out select="$xmlData/data/proposal/built_institute"/>" label="项目负责人所属内设机构或学院" >
		</td>
		<td align="right"><span class="color_red">*</span>项目所属市：</td>
		<td>
			<c:set var="address_value"><x:out select="$xmlData/data/proposal/project_address_value" /></c:set>
			<cpt:select key="project_address" id="project_address" name="project_address" onChange="initControlValue(this.id);" value="${address_value }" style="width:80%"></cpt:select>
			<input type="hidden" name="proposal/project_address_value" class="required" label="项目所属市" value="<x:out select="$xmlData/data/proposal/project_address_value" />"/>
			<input type="hidden" name="proposal/project_address_name" value="<x:out select="$xmlData/data/proposal/project_address_name" />"/>
		</td>
	</tr>
</table>

<br/>

<div class="t_bar"><span class="color_red">*</span>项目概述(限1000字)</div>
<table id="tblMileStones1" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0"
	   style="*border-bottom: #a1c0dc 1px solid;">
	<col style="width:34%"/>
	<col style="width:40%"/>
	<col style="width:13%"/>
	<col style="width:13%"/>
	<tr>
		<td colspan="4">
            <textarea name="project/summary1" style="width:98%" class="input_textarea required maxlength:1000" rows=5 cols=60><x:out select="$xmlData/data/project/summary1"/></textarea>
			<input type="hidden" name="project/summary1_hidden" id="project/summary1_hidden" value="<x:out select="$xmlData/data/project/summary1" />"/>
		</td>
	</tr>
</table>

<script type="text/javascript">
	/**
	 * 各类公用控件和radio框储存值到隐藏域中(除了tree和智能下拉框外)
	 */
	function initControlValue(objId){

		var name="";
		var obj=$("#"+objId);
		if(obj.is("select")){
			name=obj.attr("name");
			obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
			$("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
		}

		else if(obj.is(":radio")){
			name=obj.attr("name");
			if(obj.is(":checked")){//如果被选中
				//alert($("#"+objId).val());
				obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
			}
			else{

				obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
			}
		}else if(obj.is(":checkbox")){
			name=obj.attr("name");
			if(obj.is(":checked"))//如果被选中
				obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
			else
				obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
		}else{
			name=obj.attr("id");
			obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
			obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
		}
	}

	function synchronizationAmount1() {
		var built_institute = $("#built_institute").val();
		if (built_institute != "") {
			$("span[id='built_institute_[00]']").html($("#built_institute").val());
		} else if (built_institute == "") {
			$("span[id='built_institute_[00]']").html("");
		}
	}
</script>